package com.hspedu.homework.homework13;

public class Teacher extends Person {

    private int work_age;

    public Teacher(String name, char gender, int age, int work_age) {
        super(name, gender, age);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    public void teach() {
        System.out.println("我承诺，我会认真教学。");
    }

    public void f(Person person) {
        ((Teacher)person).teach();
    }

    @Override
    public String play() {
        return getName() + "爱玩象棋";
    }

    public void print() {
        System.out.println("老师的信息:\n" + "姓名: " + getName() +
                            "\n年龄: " + getAge() + "\n性别: " +
                            getGender() + "\n工龄: " + work_age);
        teach();
        System.out.println(play());
    }
}
